<template>
  <fade-animation>
    <div v-show="visible" class="header-detail" @touchmove.stop.prevent>
      <div class="detail-wrap clearfix">
        <div class="detail-main">
          <h1 class="name">{{ seller.name }}</h1>
          <div class="star-wrap">
            <star :size="48" :score="seller.score"></star>
          </div>
          <title-module titleText="优惠信息" class="title">
            <template #text="{titleText}">
              <span class="title-text">{{ titleText }}</span>
            </template>
          </title-module>
          <ul v-if="seller.supports" class="supports">
            <li
              class="support-item"
              v-for="(item, index) in seller.supports"
              :key="item.id"
            >
              <support-ico
                :size="2"
                :type="seller.supports[index].type"
              ></support-ico>
              <span class="text">{{ seller.supports[index].description }}</span>
            </li>
          </ul>
          <title-module titleText="商家公告"></title-module>
          <div class="bulletin">
            <p class="content">{{ seller.bulletin }}</p>
          </div>
        </div>
      </div>
      <div class="detail-close" @click="hide">
        <i class="icon-close"></i>
      </div>
    </div>
  </fade-animation>
</template>

<script>
import Star from 'common/star/star'
import SupportIco from 'common/icon/supportIco'
import titleModule from 'common/title/title'
import fadeAnimation from 'common/animation/fade-Animation'
import popupMixin from 'assets/mixins/popup.js'
import 'styles/base.stylus'

export default {
  name: 'HeaderDetail',
  mixins: [popupMixin],
  props: {
    seller: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  components: {
    SupportIco,
    Star,
    titleModule,
    fadeAnimation
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixin.stylus';
@import '~styles/variable.stylus';

.header-detail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 36px;
  box-sizing: border-box;
  background-color: rgba(7, 17, 27, 0.8);
  color: rgb(255, 255, 255);
  backdrop-filter: blur(10px);
  z-index: 10;

  .detail-wrap {
    min-height: 100%;
    padding-bottom: 64px;
    box-sizing: border-box;

    .detail-main {
      margin-top: 64px;

      .name {
        font-size: 16px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
      }

      .star-wrap {
        margin: 16px 0 28px;
        text-align: center;
      }

      .title {
        .title-text {
          margin: 0 12px;
          font-size: 14px;
          font-weight: 700;
          line-height: 14px;
        }
      }

      .supports {
        margin: 24px 12px 28px;

        .support-item {
          &:not(:last-child) {
            margin-bottom: 12px;
          }

          .support-ico {
            margin-right: 6px;
            vertical-align: top;
          }

          .text {
            font-size: 12px;
            font-weight: 200;
            line-height: 12px;
          }
        }
      }

      .bulletin {
        box-sizing: border-box;
        margin: 24px 12px 0;

        .content {
          font-size: 12px;
          line-height: 24px;
          font-weight: 200;
        }
      }
    }
  }

  .detail-close {
    margin-top: -64px;
    font-size: 32px;
    text-align: center;

    .content {
      font-size: 12px;
      line-height: 12px;
      font-weight: 200;
    }
  }
}
</style>
